/*
 *
 *
 *  Created on: 24/06/2009
 *      Author: banouz
 */

#ifndef SHELL_H_
#define SHELL_H_

//#include "OSThread.h"
#include "Worker.h"
#include "Mailer.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
using namespace std;

class Shell  {

  private :

    int _bufferSize;
    int _numOfNod;
    map<string, vector<string> > _graph; // map of nods and their connections
    map<string, string> _stateMap;     // map of (node,disable/enable)
    map<string, map<string, vector<string> > > _nodeRT; //map that save for each node its RTprivate:
    map<string, Worker> _workerMap;     // map of (threadID(node number),Worker)
    map< int, string> _idMap; //saves <real id,unique id>

    pthread_mutex_t _dVRMutex ;
    pthread_t  shell_thread;

    Mailer* _mailer;

  public :

    //Shell::Shell();
    Shell();
    ~Shell();
    void run();
    void createNet( string inputFile);
    void PrintRT (string uniqueID);
    void intRT (string uniqueID);
    void strWord( string line);
    void KillNode (string uniqueID);
    void ReviveNode (string uniqueID);
    void start(int algoNum,int quanta);

};


#endif /* FUCKC_H_ */
